The files in this directory are used to construct a simple example of an application that handles MacHTTP's WWWΩsrch and WWWΩsdoc AppleEvents. (See the AppleScript dictionary of the Search.exe program for more details.) The application is scriptable and supports this custom event plus the required suite of events. The only unique portions of the application are contained in the AEVT.c source file. The rest of the code is just basic Mac user interface code (and it's pretty ugly.)
The necessary files are included to build the application under Think C 6.0. There is no reason why it shouldn't build under MPW C as well. There are no Think C specifics. The only modification required for MPW may be changing all '\r' literals to '\n' and vice versa.
The files are as follows:
AEVT.c - C code initializing and implementing AppleEvent handlers
AEVT.h - related include file
Main.c - main program, event loop, initializations, etc.
Main.h - related include file
Search Example.rsrc - resource file included in Think C project
Search Example.π - Think C 6.0 project file
Search Example.π.rsrc - "compiled" resource including SIZE, etc. MPW users should use this
Search.exe - A precompiled version of the "Search Example" program
Test Search Program - an AppleScript for testing the Search.exe program
TTY_Messages.c - C code for a very simple scrolling message window
TTY_Messages.h - related include file
The program requires Mac toolbox calls as well as ANSI calls (primarily string routines and sprintf), so link with the appropriate MPW libraries.
Please feel free to use this source code in any way you see fit. I'll be glad to incorporate any neat "MacHTTP helpers" into the MacHTTP home page.